home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / GCC 1.37.1r15 / Build / MoveIfChange < prev    next >
Encoding:
Text File  |  1990-11-21  |  474 b   |  21 lines  |  [TEXT/MPS ]

  1. # Rename a file only if it is different from a previously existing file of the same
  2. # name.  This is useful for keeping make from doing too much work if the contents
  3. # of a file haven't changed.
  4. #
  5. #    Copyright © Apple Computer, Inc. 1989, 1990
  6.  
  7. set echo 0 # Build turns echo on, grumble
  8. set exit 0
  9.  
  10. if "`exists -f {2}`"
  11.   compare {1} {2} >dev:null
  12.   if {status} != 0
  13.       rename -y {1} {2}
  14.   else
  15.       echo {2} is unchanged
  16.       delete -i -y {1}
  17.   end
  18. else
  19.   rename -y {1} {2}
  20. end
  21.